import service from "@/utils/request";
import type { Response, PageResponse } from "@/types/common";
import type { AccessDoorItem } from "@/types/access/door";

export const useAccessDoorPageApi = (params: object) => {
  return service<any, Response<PageResponse<AccessDoorItem>>>({
    url: `/v1/access/door/page`,
    method: "GET",
    params,
  });
};

export const useAccessDoorQueryApi = (params: object) => {
  return service<any, Response<AccessDoorItem>>({
    url: `/v1/access/door/query`,
    method: "GET",
    params,
  });
};

export const useAccessDoorCreateApi = (data: object) => {
  return service({
    url: `/v1/access/door/create`,
    method: "POST",
    data,
  });
};

export const useAccessDoorUpdateApi = (data: object) => {
  return service({
    url: `/v1/access/door/update`,
    method: "POST",
    data,
  });
};

export const useAccessDoorDeleteApi = (data: object) => {
  return service({
    url: `/v1/access/door/delete`,
    method: "DELETE",
    data,
  });
};
